<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'login.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<style type="text/css">
			/*层1的样式*/
			.div1 { /*本层要实现覆盖模式窗口以外全部内容的半透明效果*/
				background-color: rgb(0, 0, 0); /*背景色*/
				opacity: 0.3;
				position: absolute; /*绝对定位，必选，使层绝对依照top,left的标准显示，否则将不能实现覆盖*/
				top: 0; /*层与页面顶部距离*/
				left: 0; /*层与左侧边距离*/
				z-index: 1; /*当发生重叠时的优先级，数大的会覆盖数较小的，没进行设置的均可视为小于0*/
				display: inline; /*层是否可见，初始化none不可见*/
				filter: Alpha(opacity =     30); /*过滤颜色，设置透明度（可见度）30，数越小越透明*/
			}

			/*层2的样式*/
			.div2 { /*本层显示在最前端，其它控件均不可用*/
				width: 300px; /*显示宽度*/
				height: 200px; /*显示高度*/
				position: absolute; /*绝对定位*/
				z-index: 2; /*优先级*/
				display: inline; /*是否显示*/
				border: 0px; /*边框：宽度，样式，颜色*/
				background-color:white; /*背景色*/
			}
			#body-left{ float:left;}
 			#body-right {float:left;}
		/*当然你可以自定义添加或更改更多的样式都无所谓*/
		</style>
		<script type="text/javascript">
			function login()
			{
				var username = document.getElementById("username").value;
				var password = document.getElementById("password").value;
				if(username==''||password==''){
					document.getElementById("message").innerHTML = "用户名或密码不能为空";
					return;
				}
				document.getElementById("login").submit();
			}
			function init(){
				if("${message}"=="" && "${eauser}"!=""){
					window.parent.location = "mok/usedcar/index.jsp";
				}
			}
		</script>
  </head>
  
  <body style="margin-left: 500px" onload="init()">
    <div id="div1" class="div1"></div>

		<div id="div2" class="div2">
			<!--这是弹出的模式窗口层-->
			<!--嵌套在层中的层，用来做标题栏，按个人需求定义-->
			<div style="border-bottom:solid;border-bottom-width: 1px ;border-bottom-color: silver;width: 100%;height: 20px;">
				<div id="body-left" align="left" style="width: 80%;">
					<label style="font-weight: bolder;">
						登录
					</label>
				</div>
				<div id="body-right"
					style="width: 20%; height: 20px; background-color: #FFFFFF"
					align="right">
					<label onClick="window.location='usedcar/viewSaleUsedCar_show'"
						style="font-weight: bolder; cursor: pointer">
						关闭
						<!--用来关闭显示，在label中加了onclick事件，与鼠标悬停手的样式-->
					</label>
				</div>
			</div>
			<div style="height: 160px">
				<center></br>
				<form id="login" action="usedcar/viewSaleUsedCar_login">
				用户名&nbsp;&nbsp;<input type="text" name="username" id="username">
				</br></br>
				密&nbsp;&nbsp;码&nbsp;&nbsp;<input type="password" name="password" id="password">
				</br>
				<span style="color: red;" id="message">${message}</span></br>   
				<input type="button" value="登录" onclick="login()">
				</form>
				</center>
				</div>
			<div style="border-top:solid;border-top-width: 1px ;border-top-color: silver;width: 100%;height: 20px;">
			<center>
					<label style="font-weight: bolder;">
						还没有帐号？
					</label>
					<a href="register.jsp" target="_blank">
						立即注册
					</a>
			</center>
			</div>
		</div>
  </body>
</html>
